Attribute VB_Name = "stringFunctions"
''''''''''''''''''''''''''''''''''
' 一些字符串处理函数
''''''''''''''''''''''''''''''''''''

Function TiQuTezheng(remark As String) As String
    Dim mRegExp As Object
    Dim mMatches As Object
    Set mRegExp = CreateObject("Vbscript.Regexp")
    mRegExp.Pattern = "代理业务种类名称:(.*?) "
    Set mMatches = mRegExp.Execute(remark)
    mtype = mMatches(0).submatches(0)
    Dim found as boolean
    Select Case mtype
        Case "电费"
            mRegExp.Pattern = "(电费结算号\d+)"
            found = true
        Case "水费"
            mRegExp.Pattern = "(合同号或协议号:.*?) "
            found = true
        Case "手机费"
            mRegExp.Pattern = "(手机费 合同号:.*?) "
            found = true
        Case "委托收款"
            mRegExp.Pattern = "(合同号或协议号:.*?) "
            found = true
        Case "固话费"
            mRegExp.Pattern = "(固话费 合同号:.*?) "
            found = true
    End Select
    if found = true 
        Set mMatches = mRegExp.Execute(remark)
        TiQuTezheng = mMatches(0).submatches(0)
    else
        TiQuTezheng = ""
    end if

End Function